Charts Style
The Chart component in the Scripting app provides a highly customizable interface for creating and displaying various types of charts. This documentation explains how to use the properties of the Chart view to configure axes, scales, labels, legends, and more.
1. Axis Visibility
-
chartXAxis- Type:
"automatic" | "hidden" | "visible" - Description: Sets the visibility of the X-axis.
- Example:
- Type:
-
chartYAxis- Type:
"automatic" | "hidden" | "visible" - Description: Sets the visibility of the Y-axis.
- Example:
- Type:
2. Axis Labels
-
chartXAxisLabel- Type:
- Description: Adds a label to the X-axis.
- Example:
- Type:
-
chartYAxisLabel- Type: Same as
chartXAxisLabel. - Description: Adds a label to the Y-axis.
- Example:
- Type: Same as
3. Legend
chartLegend- Type:
- Description: Configures the chart legend.
- Example:
- Type:
4. Scales
chartXScale/chartYScale- Type:
- Description: Configures the X or Y-axis scale.
- Example:
- Type:
5. Background
chartBackground- Type:
- Description: Adds a background to the chart container.
- Example:
- Type:
6. Foreground Style
chartForegroundStyleScale- Type:
- Description: Customizes colors for marks in the chart.
- Example:
- Type:
7. Scrollable Axes
chartScrollableAxes- Type:
- Description: Enables scrolling for the specified axes.
- Example:
- Type:
8. Selection
chartXSelection/chartYSelection/chartAngleSelection- Type:
- Description: Enables selection for the specified axis.
- Example:
- Type:
9. Scroll Position
chartScrollPositionX/chartScrollPositionY- Type:
- Description: Sets the initial scroll position along the X or Y-axis.
- Example:
- Type:
Comprehensive Example
The following example demonstrates the usage of multiple properties to create a fully customized chart:
This example combines axis labels, scrolling, legend, scales, foreground styles, and multiple chart types in a single Chart container. Use it as a template for building your own charts.
